#include "math_operator.h"
#include "data_type.h"
#include "test_file_1.h"
#include <algorithm>
#include <iterator>
#include <vector>
namespace segment {

    void test1_pointcloud::set_boundary(PointList &array) {
      std::sort(std::begin(array), std::end(array), compare_x_axis);
      double min_x = array.begin().x;
      double max_x = array.end().x;
      std::sort(std::begin(array), std::end(array), compare_y_axis);
      double min_y = array.begin().y;
      double max_y=array.end().y;
    }

    Center test1_pointcloud::get_center(min_x, max_x, min_y, max_y) {
      Center center;
      double center.x = (min_x + max_x) / 2;
      double center.y = (min_y + max_y) / 2;
      return center;
    }


    std::vector<Center> test1_pointcloud::get_t_cross_list() {
        std::vector<Center> cross_list; 
        Center up, right, down, left;
        up = {(min_x+max_y)/2, min_y};
        right = {max_x, (min_y+max_y)/2};
        down = {(min_x+max_x)/2, max_y};
        left = {min_x, (min_y+max_y)/2};
        cross_list.push_back(up);
        cross_list.push_back(up_right);
        cross_list.push_back(down_right);
        cross_list.push_back(down_left);
        return cross_list;
    }



    

    
}